<?php if(isset($r['service_info'])){?>
<form action="<?php e_page("service","index")?>" method="get">
    <fieldset>
        <legend></legend>
        <label for="header_name">负 责 人 </label><br/>
        <input type="text" name="header_name" id="header_name" placeholder="请输入负责人姓名"/><br/>
        <label for="header_tel">负责人电话</label><br/>
        <input type="text" name="header_tel" id="header_tel" placeholder="请输入负责人电话"/><br/>
        <label for="service_name">服务站名称</label><br/>
        <input type="text" name="service_name" id="service_name" placeholder="请输入服务站名称"/>
<!--        <label for="address">服务站地址</label>-->
<!--        <input type="text" name="address" id="address" placeholder="请输入服务站地址"/><br/>-->
        <input type="submit" value="搜索"/>
    </fieldset><br/>
</form>
<table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>服务站名称</th>
        <th>服务站地址</th>
        <th>管理人/联系方式</th>
        <th>负责人/联系方式</th>
        <th>审核通过/冻结</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($r['service_info'] as $v){?>
        <tr>
            <td><?php echo $v['id'];?></td>
            <td><?php echo $v['service_name']?></td>
            <td><?php echo $v['address_id'];echo $v['address_text'];?></td>
            <td><?php echo $v['real_name']?> <?php echo $v['tel']?></td>
            <td><?php echo $v['header_name']?> <?php echo $v['header_tel']?></td>
            <td><?php if($v['enable']==1){?>  <?php echo "已通过/";}else{?>  <a href="<?php e_action("checkPass","id={$v['id']}")?>">通过</a> <?php }?>   <?php if($v['enable']==1){?>    <a href="<?php e_action("checkCancel","id={$v['id']}")?>">冻结</a><?php }?></td>
            <td><a href='<?php e_action("serviceModify","id={$v['id']}");?>'>修改</a>/<a href='<?php e_action("serviceDelete","id={$v['id']}");?>' onclick="return confirm('确定删除吗？');">删除</a></td>
        </tr>
    <?php } ?>
    </tbody>
</table>
<?php
/** @var Page $page */
$page=$r['pages'];
?>
<?php echo $page->getPageHtml(); ?>
<?php }else if(!empty($r['search'])){?>
<table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>服务站名称</th>
        <th>服务站地址</th>
        <th>负责人/联系方式</th>
        <th>管理人/联系方式</th>
        <th>审核通过/冻结</th>
        <th>操作</th>
    </tr>
    </thead>
    <?php foreach($r['search'] as $v){?>
        <tbody>
        <tr>
            <td><?php echo $v['id'];?></td>
            <td><?php echo $v['service_name']?></td>
            <td><?php echo $v['address_id'];echo $v['address_text'];?></td>
            <td><?php echo $v['tel']?></td>
            <td><?php echo $v['header_tel']?></td>
            <td><?php if($v['enable']==1){?>  <?php echo "已通过/";}else{?>  <a href="<?php e_action("checkPass","id={$v['id']}")?>">通过</a> <?php }?>   <?php if($v['enable']==1){?>    <a href="<?php e_action("checkCancel","id={$v['id']}")?>">冻结</a><?php }?></td>
            <td><a href='<?php e_action("serviceModify","id={$v['id']}");?>'>修改</a>/<a href='<?php e_action("serviceDelete","id={$v['id']}");?>' onclick="return confirm('确定删除吗？');">删除</a></td>
        </tr>
    </tbody>
    <?php }?>
</table>
<?php }else{ echo "暂无此服务站信息"?>
<?php }?>